package com.jaws.demo.common.enums;


/**
 * 账户表ID生成策略枚举<br/>
 * <p>
 * ACCOUNT_INFO:account_info<br/>
 * ACCOUNT_FROZEN:account_frozen<br/>
 * ACCOUNT_ORDER:account_order<br/>
 *
 * @author maojian
 * @date 2017-05-27 16:45:06
 * @since v1.0.0
 */
public enum TableSequenceEnum {

	ACCOUNT_INFO("account_info", "I", 50, 20),
	ACCOUNT_FROZEN("account_frozen", "F", 5000, 32),
	ACCOUNT_ORDER("account_order", "O", 5000, 32),
	ACCOUNT_TRADE_FROZEN("account_trade_frozen", "TF", 5000, 32);

	private final String key;

	private final String prefix;

	private final int step;

	private final int len;

	/**
	 * 构造函数
	 *
	 * @param key    业务主键key
	 * @param prefix 前缀
	 * @param step   连续生成主键的步长
	 * @param len    最终生成的业务主键长度
	 */
	private TableSequenceEnum(String key, String prefix, int step, int len) {
		this.key = key;
		this.prefix = prefix;
		this.step = step;
		this.len = len;
	}

	public String getKey() {
		return key;
	}

	public String getPrefix() {
		return prefix;
	}

	public int getLen() {
		return len;
	}

	public int getStep() {
		return step;
	}

}
